import request from '@/utils/request'

//登录
export const login = (data) => {
  return request.request({
    url: '/sso/school/login',
    method: 'post',
    data,
  })
}
//资产来源列表
export const proSourcelist = (data) => {
  return request.request({
    url: '/school/base/proSource/listByPage',
    method: 'post',
    data,
  })
}
//资产来源添加
export const proSourceadd = (data) => {
  return request.request({
    url: '/school/base/proSource/add',
    method: 'post',
    data,
  })
}
//资产来源编辑
export const proSourceedit = (data) => {
  return request.request({
    url: '/school/base/proSource/edit',
    method: 'post',
    data,
  })
}
//资产来源删除
export const proSourcedel = (id) => {
  return request.request({
    url: `/school/base/proSource/del/${id}`,
    method: 'get',
  })
}

//耗材仓库添加
export const repoadd = (data) => {
  return request.request({
    url: '/school/base/repo/add',
    method: 'post',
    data,
  })
}
//耗材仓库列表
export const repolist = (data) => {
  return request.request({
    url: '/school/base/repo/listByPage',
    method: 'post',
    data,
  })
}
//耗材仓库删除
export const repodel = (id) => {
  return request.request({
    url: `/school/base/repo/del/${id}`,
    method: 'get',
  })
}
//耗材仓库编辑
export const repoedit = (data) => {
  return request.request({
    url: '/school/base/repo/edit',
    method: 'post',
    data,
  })
}
//报废原因添加
export const scrapadd = (data) => {
  return request.request({
    url: '/school/base/scrap/add',
    method: 'post',
    data,
  })
}
//报废原因列表
export const scraplist = (data) => {
  return request.request({
    url: '/school/base/scrap/listByPage',
    method: 'post',
    data,
  })
}
//报废原因删除
export const scrapdel = (id) => {
  return request.request({
    url: `/school/base/scrap/del/${id}`,
    method: 'get',
  })
}
//报废原因编辑
export const scrapedit = (data) => {
  return request.request({
    url: '/school/base/scrap/edit',
    method: 'post',
    data,
  })
}
//耗材入库弹窗来源
export const proSource = () => {
  return request.request({
    url: '/school/select/proSource',
    method: 'get',
  })
}
//耗材入库弹窗仓库
export const repository = () => {
  return request.request({
    url: '/school/select/repository',
    method: 'get',
  })
}
//耗材入库添加
export const consumaddexcel = (data) => {
  return request.request({
    url: '/school/consum/add/excel',
    method: 'post',
    data,
  })
}
//耗材入库列表
export const storelistByPage = (data) => {
  return request.request({
    url: '/school/consum/store/listByPage',
    method: 'post',
    data,
  })
}
//耗材入库编辑列表
export const detailByPage = (data) => {
  return request.request({
    url: '/school/consum/detailByPage',
    method: 'post',
    data,
  })
}
//耗材入库编辑提交
export const storeedit = (data) => {
  return request.request({
    url: '/school/consum/store/edit',
    method: 'post',
    data,
  })
}
//耗材入库删除
export const storedel = (id) => {
  return request.request({
    url: `/school/consum/store/del/${id}`,
    method: 'get',
  })
}
//耗材列表
export const listByPage = (data) => {
  return request.request({
    url: '/school/consum/listByPage',
    method: 'post',
    data,
  })
}
//耗材出库-添加出库单-添加
export const outdetailByPage = (data) => {
  return request.request({
    url: '/school/consum/out/add/detailByPage',
    method: 'post',
    data,
  })
}
//耗材出库-添加出库单-领用人
export const userSelect = (id) => {
  return request.request({
    url: `/school/consum/out/userSelect`,
    method: 'get',
  })
}
//耗材出库-添加
export const outadd = (data) => {
  return request.request({
    url: `/school/consum/out/add`,
    method: 'post',
    data,
  })
}
//耗材出库列表
export const outlistByPage = (data) => {
  return request.request({
    url: `/school/consum/out/listByPage`,
    method: 'post',
    data,
  })
}
//耗材出库-编辑-列表
export const outdetail = (data) => {
  return request.request({
    url: `/school/consum/out/detailByPage`,
    method: 'post',
    data,
  })
}
//耗材出库-编辑
export const outedit = (data) => {
  return request.request({
    url: `/school/consum/out/edit`,
    method: 'post',
    data,
  })
}
//耗材出库-删除
export const outdel = (id) => {
  return request.request({
    url: `/school/consum/out/del/${id}`,
    method: 'get',
  })
}
//资产列表
export const propertylistByPage = (data) => {
  return request.request({
    url: `/school/property/listByPage`,
    method: 'post',
    data,
  })
}
//资产列表导出
export const propertylistexport = (data) => {
  return request.request({
    url: `/school/property/export`,
    method: 'post',
    responseType: 'blob',
    data,
  })
}
//资产列表详情
export const propertyinfo = (epc) => {
  return request.request({
    url: `/school/property/info/${epc}`,
    method: 'get',
  })
}
//资产列表编辑
export const propertyedit = (data) => {
  return request.request({
    url: `/school/property/edit`,
    method: 'post',
    data,
  })
}
//资产入库
export const storelistPage = (data) => {
  return request.request({
    url: `/school/property/store/listByPage`,
    method: 'post',
    data,
  })
}
//资产入库详情列表
export const storelistDetail = (data) => {
  return request.request({
    url: `/school/property/store/listDetail`,
    method: 'post',
    data,
  })
}
//资产报修/报废列表
export const scraplistDetail = (data) => {
  return request.request({
    url: `/school/property/scrap/listByPage`,
    method: 'post',
    data,
  })
}
//资产报修详情列表
export const scrapDetail = (data) => {
  return request.request({
    url: `/school/property/scrap/listDetail`,
    method: 'post',
    data,
  })
}
//首页资产驾驶舱
export const getBaseInfo = () => {
  return request.request({
    url: `/school/index/getBaseInfo`,
    method: 'get',
  })
}
//资产状态图表
export const getStatePie = () => {
  return request.request({
    url: `/school/index/getStatePie`,
    method: 'get',
  })
}
//资产分类图表
export const getCategoryBar = () => {
  return request.request({
    url: `/school/index/getCategoryBar`,
    method: 'get',
  })
}
//耗材总览图表
export const getConSumBar = () => {
  return request.request({
    url: `/school/index/getConSumBar`,
    method: 'get',
  })
}
//耗材仓库图表
export const getConSumPie = () => {
  return request.request({
    url: `/school/index/getConSumPie`,
    method: 'get',
  })
}
//资产概况汇总-数据
export const getCountBase = () => {
  return request.request({
    url: `/school/count/getCountBase`,
    method: 'get',
  })
}
//资产概况汇总-使用部门
export const getUsePie = () => {
  return request.request({
    url: `/school/count/getUsePie`,
    method: 'get',
  })
}
//资产概况汇总-入库统计
export const getCountInBar = () => {
  return request.request({
    url: `/school/count/getCountInBar`,
    method: 'get',
  })
}
//资产概况汇总-报修报废
export const getCountScrapBar = () => {
  return request.request({
    url: `/school/count/getCountScrapBar`,
    method: 'get',
  })
}
//资产概况汇总-区域统计
export const getCountAreaPie = () => {
  return request.request({
    url: `/school/count/getCountAreaPie`,
    method: 'get',
  })
}
//资产分类汇总
export const getCountCategory = () => {
  return request.request({
    url: `/school/count/getCountCategory`,
    method: 'get',
  })
}
//资产位置汇总
export const getCountPlace = () => {
  return request.request({
    url: `/school/count/getCountPlace`,
    method: 'get',
  })
}
//盘点添加负责人下拉
export const getHead = () => {
  return request.request({
    url: `/school/check/getHead`,
    method: 'get',
  })
}
//盘点列表添加
export const checkaddexcel = (data) => {
  return request.request({
    url: `/school/check/add/excel`,
    method: 'post',
    data,
  })
}
//盘点列表
export const checklistByPage = (data) => {
  return request.request({
    url: `/school/check/listByPage`,
    method: 'post',
    data,
  })
}
//盘点编辑详情回显
export const checkdetail = (id) => {
  return request.request({
    url: `/school/check/detail/${id}`,
    method: 'get',
  })
}
//盘点编辑列表
export const checkdetaillistByPage = (data) => {
  return request.request({
    url: `/school/check/detail/listByPage`,
    method: 'post',
    data,
  })
}
//盘点编辑列表
export const checkedit = (data) => {
  return request.request({
    url: `/school/check/edit`,
    method: 'post',
    data,
  })
}
//盘点列表删除
export const checkdel = (id) => {
  return request.request({
    url: `/school/check/del/${id}`,
    method: 'get',
  })
}
//盘点列表恢复
export const repaired = (epc) => {
  return request.request({
    url: `school/repaired/repBack/${epc}`,
    method: 'get',
  })
}
